package com.wangbl.infomanager;

import cn.jpush.android.api.JPushInterface;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

public class SplashActivity extends Activity {
	
	private Handler handler = new Handler();
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);
		init();
	}
	
	private void init(){
		handler.postDelayed(run, 2000);
	}
	
	private Runnable run = new Runnable() {
		
		@Override
		public void run() {
			Intent intent = new Intent(SplashActivity.this,LoginActivity.class);
			startActivity(intent);
			finish();
		}
	};
	@Override
	public void onBackPressed() {
		super.onBackPressed();
		handler.removeCallbacks(run);
	}
	
	@Override
	protected void onResume() {
		super.onResume();
		JPushInterface.onResume(getApplicationContext());
	}
	
	@Override
	protected void onPause() {
		super.onPause();
		JPushInterface.onPause(getApplicationContext());
	}

}
